package com.lzy.cloud.payment.service.impl;

import com.lzy.cloud.payment.dtos.payment.PayRefundInfoDto;
import com.lzy.cloud.payment.entity.PayRefundInfo;
import com.lzy.cloud.payment.mapper.PayRefundInfoMapperExt;
import com.lzy.cloud.payment.service.PayRefundInfoService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayRefundInfoServiceImpl implements PayRefundInfoService {
    @Autowired
    PayRefundInfoMapperExt payRefundInfoMapperExt;

    @Override
    public PayRefundInfo queryPayRefundInfoByOrderId(String orderId) {
        return payRefundInfoMapperExt.queryPayRefundInfoByOrderId(orderId);
    }

    @Override
    public int updatePayRefundInfo(PayRefundInfoDto priDO) {
        return payRefundInfoMapperExt.updateByPrimaryKeySelective(DozerUtils.map(priDO,PayRefundInfo.class));
    }

    @Override
    public int createPayRefundInfo(PayRefundInfo payRefundInfo) {
        return payRefundInfoMapperExt.insertSelective(payRefundInfo);
    }

    @Override
    public List<PayRefundInfoDto> queryPayRefundInfo(PayRefundInfoDto payRefundInfoDto) {
        return payRefundInfoMapperExt.queryPayRefundInfoList(payRefundInfoDto);
    }
}
